package com.zzyl.serve.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.zzyl.common.core.domain.R;
import com.zzyl.serve.dto.MemberLoginDto;
import com.zzyl.serve.vo.MemberLoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zzyl.common.annotation.Log;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.enums.BusinessType;
import com.zzyl.serve.domain.FamilyMember;
import com.zzyl.serve.service.IFamilyMemberService;
import com.zzyl.common.utils.poi.ExcelUtil;
import com.zzyl.common.core.page.TableDataInfo;

/**
 * 老人家属Controller
 * 
 * @author GX
 * @date 2025-08-21
 */
@Api(tags = "老人家属管理")
@RestController
@RequestMapping("/member/user")
public class FamilyMemberController extends BaseController
{
    @Autowired
    private IFamilyMemberService familyMemberService;


    /**
     * 接收wx.login获取的code、phone、nickname
     * 通过微信api获取openid和session_key
     * 根据openid去查询客户信息
     * 判断是否存在，否要创，是要去获得手机号，决定是否要更新
     * */
    @PostMapping("/login")
    @ApiOperation("家属小程序登录")
    public AjaxResult login(@RequestBody MemberLoginDto memberLoginDto){
        MemberLoginVo loginVo = familyMemberService.getLoginInfo(memberLoginDto);
        return AjaxResult.success(loginVo);
    }
}
